package com.study.example.study.extension.easyexcel.read;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.study.example.study.extension.easyexcel.write.EasyExcelWriteGenderConverter;
import com.study.example.study.extension.easyexcel.write.EasyExcelWriteNullStrConverter;
import com.study.example.study.extension.easyexcel.write.EasyExcelWriteStatusConverter;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * 读 demo 类
 *
 * @author RenYuLiang
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class EasyExcelReadDataDemoDTO implements Serializable {

    private static final long serialVersionUID = 5877762307870090347L;

    /**
     * 第1列
     */
    @ExcelProperty(index = 0)
    private String string;
    /**
     * 第2列
     */
    @ExcelProperty(index = 1)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date date;
    /**
     * 第3列
     */
    @ExcelProperty(index = 2)
    @NumberFormat("#.##%")
    private Double doubleData;
    /**
     * 第4列
     */
    @ExcelProperty(index = 3, value = "性别", converter = EasyExcelWriteGenderConverter.class)
    private Integer gender;
    /**
     * 第5列
     */
    @ExcelProperty(index = 4, value = "状态", converter = EasyExcelWriteStatusConverter.class)
    private String status;
    /**
     * 第6列
     */
    @ExcelProperty(index = 5, value = "空值", converter = EasyExcelWriteNullStrConverter.class)
    private String nullStr;
    /**
     * 忽略该字段
     */
    @ExcelIgnore
    private String ignore;

}
